find_library( OPENGLES3_LIBRARY GLESv2 "OpenGL ES v3.0 library")
find_library( EGL_LIBRARY EGL "EGL 1.4 library" )
message("Find OpenGLES ${OPENGLES3_LIBRARY}")
message("Find EGL ${EGL_LIBRARY}")
if(OPENGLES3_LIBRARY MATCHES "OPENGLES3_LIBRARY-NOTFOUND")
    message("link local lib for OPENGLES3_LIBRARY")
	link_directories(${PROJECT_SOURCE_DIR}/lib)
	if(WIN32)
	set(OPENGLES3_LIBRARY ${PROJECT_SOURCE_DIR}/lib/opengles/libGLESv2.lib)
	else()
	set(OPENGLES3_LIBRARY ${PROJECT_SOURCE_DIR}/lib/opengles/libGLESv2.so)
	endif()
endif()
if(EGL_LIBRARY MATCHES "EGL_LIBRARY-NOTFOUND")
    message("link local lib for EGL_LIBRARY")
	link_directories(${PROJECT_SOURCE_DIR}/lib/opengles)
	if(WIN32)
	set(EGL_LIBRARY ${PROJECT_SOURCE_DIR}/lib/opengles/libEGL.lib)
	else()
	set(EGL_LIBRARY ${PROJECT_SOURCE_DIR}/lib/opengles/libEGL.so)
	endif()
endif()
